

from rest_framework import serializers

from apps.invite.models import Recruit, Enterprise, City


class RecommendSerializer(serializers.ModelSerializer):
    class Meta:
        model = Recruit
        fields ="__all__"


class EnterpriseSerializer(serializers.ModelSerializer):
    class Meta:
        model = Enterprise
        fields = ('id', 'name', 'labels', 'logo', 'recruits', 'summary')


class RecruitSerializer(serializers.ModelSerializer):
    enterprise = EnterpriseSerializer(Enterprise.objects.all())

    class Meta:
        model = Recruit
        fields = '__all__'

class EnterpriseDetailSerializer(serializers.ModelSerializer):
    # recruits = RecruitSerializer(many=True)
    # users = serializers.PrimaryKeyRelatedField(read_only=True, many=True)


    class Meta:
        model = Enterprise
        # fields = ('id', 'name', 'labels', 'logo', 'recruits', 'summary')
        fields = '__all__'


class HotCitySerializer(serializers.ModelSerializer):
    class Meta:
        model = City
        fields ="__all__"



